<?php

namespace App\Services;

use App\GameChannel\SdkBase;
use App\Models\GameChannel;
use App\Models\Games;

class LoginService extends ServiceBase
{
    // 校验当前是否开放登录入口
    public function canLogin($game_id, $game_channel_id)
    {
        $game = Games::where('game_id', $game_id)->first();
        if ($game->can_login != 1) {
            return false;
        }

        $game_channel = GameChannelService::getInstance()->get($game_channel_id);
        if ($game_channel['can_login'] != 1) {
            return false;
        }

        return true;
    }
}
